<reply :attributes="{{$reply}}" inline-template v-cloak>
    <div class="card mt-2" id="reply-{{$reply->id}}">
        <div class="card-body">
            <div class="card-title">
                <div class="level">
                    <h5 class="flex">
                <span class="flex">
                     <a href="{{route('profile',[$reply->owner])}}"> {{ $reply->owner->name }}</a>
                回复于
                    {{ $reply->created_at->diffForHumans() }}
                </span>
                    </h5>
                    @if(Auth::check())
                        <div>
                            <favorite :reply="{{ $reply }}"></favorite>
                        </div>
                    @endif
                </div>
            </div>
            <hr>
            <div class="card-text">
                <div v-if="editing">
                    <div class="form-group">
                        <textarea class="form-control" v-model="body"></textarea>
                    </div>
                    <button class="btn btn-sm btn-primary" @click="update">Update</button>
                    <button class="btn btn-sm btn-link" @click="editing = false">Cancel</button>

                </div>
                <div v-else v-text="body"></div>
            </div>

        </div>
        @can('update',$reply)
            <footer class="card-footer level">
                <button class="btn btn-sm mr-1" @click="editing = true">Edit</button>
                <button class="btn btn-sm mr-1 btn-danger" @click="destroy">Delete</button>
            </footer>
        @endcan
    </div>
</reply>
